<!-- 特殊筛查 -->

<template>
  <div>
    <table-no-height
        :dataSource="dataSource"
        :tableColumns="tableColumns"
        :height="500"
    ></table-no-height>
  </div>
</template>

<script>
import tableNoHeight from "@/components/customComponents/customeTable/tableNoHeight"
import {AjaxCommon} from "@/libs/apiCommon"
import {PopupCommon} from "@/libs/popupCommon"

export default {
  props: ["userInfo", "type", "isFirst"],
  components: {
    tableNoHeight,
  },
  data() {
    return {
      dataSource: [],
      tableColumns: [
        {
          prop: "specialCheckItem",
          label: "检查项",
          width: 120,
          dictName: "Inspection_items",
        },
        {
          prop: "checkBeginTime",
          label: "检查开始时间",
          width: 160,
        },
        {
          prop: "checkEndTime",
          label: "检查结束时间",
          width: 160,
        },
        {
          prop: "checkJudge",
          label: "检查结果",
          width: 120,
          dictName: "check_judge",
        },
        {
          prop: "createByName",
          label: "检查人",
          width: 120
        },
        {
          prop: "verifyByName",
          label: "核对人",
          width: 120,
        },
        {
          prop: "remarks",
          label: "异常备注",
          width: 300
        },
      ],
    }
  },
  methods: {
    // 初始化事件
    initPage() {
      let self = this
      let url =
          this.type == "filter"
              ? "/ccdc/pm/em/filter/emFilterSpecialCheck/listByPage"
              : "/ccdc/pm/em/in/emInSpecialCheck/listByPage"
      // 这里的isFirst 不一定是boolen类型
      let first = this.isFirst ? true : false
      AjaxCommon(
          url,
          "post",
          {
            examineeCode: [self.userInfo.examineeCode],
            pageNo: 1,
            pageSize: 1000,
          },
          first
      ).then((res) => {
        if (res.data.code == 200) {
          self.dataSource = res.data.result.records
          self.pageCount = res.data.result.total
        } else {
          PopupCommon.notify("error", res.data.message)
        }
      })
    },
  },
  mounted() {
    this.initPage()
  },
}
</script>
